IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'spTletters_Update')
	BEGIN
		PRINT 'Dropping Procedure spTletters_Update'
		DROP  Procedure  spTletters_Update
	END

GO

PRINT 'Creating Procedure spTletters_Update'
GO
Create Procedure dbo.spTletters_Update
	( 	  
		@letterid int, 
		@ilpnumber varchar(50) = null, 
		@letterreference varchar(50) = null, 
		@letternotes varchar(500) = null, 
		@letteruser varchar(50) = null, 
		@senttoprimaryemail varchar(50) = null, 
		@senttosecondaryemail varchar(50) = null
	)
AS
  /* 
    ------------------------------------------------------------------------------
    - Change History
    - --------------
    - Date          Description
    ------------------------------------------------------------------------------
    - 9/2/2007    Initial version Updated
    ------------------------------------------------------------------------------
  */

	-- Declare the required variables

	-- Update the required new record
	UPDATE Tletters
	SET
		ilpnumber = @ilpnumber, 
		letterreference = @letterreference, 
		letternotes = @letternotes, 
		letteruser = @letteruser, 
		senttoprimaryemail = @senttoprimaryemail, 
		senttosecondaryemail = @senttosecondaryemail		
	WHERE letterid = @letterid

	-- Return to calling method
	RETURN
	
GO
